<article class="module width_full">
    <header></header>
    <div class="module_content">
        <fieldset>
            <label>Tiêu đề</label>
            <input type="text" class="fonttext" id="txtTitle" value="<?php if(isset($update)){echo $update[0]->news_title;} ?>">
        </fieldset>
        <fieldset>
            <label>Mô tả ngắn</label>
            <textarea rows="3" class="fonttext" id="txtShortDesc"><?php if(isset($update)){echo $update[0]->short_desc;} ?></textarea>
        </fieldset>
        <fieldset>
            <label>Nội dung</label>
            <div class="clear"></div>
            <textarea rows="12" class="fonttext" id="txtFullDesc"><?php if(isset($update)){echo $update[0]->long_desc;} ?></textarea>
            <fieldset> <!-- to make two field float next to one another, adjust values accordingly -->
                <label>Hình ảnh</label>
                <form enctype="multipart/form-data" id="formUpload" action="/st_upload" method="post">
                    <input type="file" id="fileImageUpload" name="fileImageUpload">
                    <input type="button" id="btnImageUpload" value="Đăng hình" onclick="BE.uploadImage();" />
                </form>
                <div id="resultImage"></div>
            </fieldset>
        </fieldset>
        <fieldset> <!-- to make two field float next to one another, adjust values accordingly -->
            <label>Nhãn</label>
            <input type="text" class="fonttext" id="txtTag" value="<?php if(isset($update)){echo $update[0]->news_tag;} ?>">
        </fieldset>
        <fieldset> <!-- to make two field float next to one another, adjust values accordingly -->
            <label>Hình đại diện</label>
            <form enctype="multipart/form-data" id="formImgThumb" action="/st_upload" method="post">
                <input type="file" id="fileImageThumb" name="fileImageUpload">
                <input type="button" id="btnImageThumb" value="Đăng hình" onclick="BE.uploadImageThumb();" />
            </form>
            <div id="resultImageThumb"><?php if(isset($update)){echo $update[0]->image_thumb;} ?></div>
        </fieldset>
        <div class="clear"></div>
    </div>
    <footer>
        <div class="submit_link">
            <select style="margin-right: 10px;" id="optionSave">
                <?php 
                $select = 0;
                if(isset($update)){
                    $select = $update[0]->status;
                }
                ?>
                <option value="0" <?php if($select==0){echo "selected";}?>>Lưu bản nháp</option>
                <option value="1" <?php if($select==1){echo "selected";}?>>Xuất bản</option>
            </select>
            <?php 
            if(isset($update)){
            ?>
            <input type="hidden" id="newsId" value="<?php echo $update[0]->news_id; ?>" />
            <input id="btnSave" type="submit" value="Cập nhật" class="alt_btn" style="margin-right: 10px;" onclick="BE.updateNew();">
            <?php
            }
            else{
            ?>
            <input id="btnSave" type="submit" value="Lưu" class="alt_btn" style="margin-right: 10px;" onclick="BE.addNew();">
            <?php
            }
            ?>
            <input id="btnReset" type="submit" value="Nhập lại" onclick="BE.addNewReset();">
        </div>
    </footer>
</article>
<script type="text/javascript">
    CKEDITOR.replace('txtFullDesc');
</script>